<%@ page import="com.scu.hotelsystem.util.DateConverter" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <title>酒店客房管理系统</title>
    <meta charset="utf-8">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Vendor: Bootstrap 4 Stylesheets  -->
    <link rel="stylesheet" href="css/jquery-ui.min.css">
    <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">

    <!-- Our Website CSS Styles -->
    <link rel="stylesheet" href="css/icons.min.css" type="text/css">
    <link rel="stylesheet" href="css/main.css" type="text/css">
    <link rel="stylesheet" href="css/responsive.css" type="text/css">

    <!-- Color Scheme -->
    <link rel="stylesheet" href="css/color-schemes/color.css" type="text/css" title="color3">
    <link rel="alternate stylesheet" href="css/color-schemes/color1.css" title="color1">
    <link rel="alternate stylesheet" href="css/color-schemes/color2.css" title="color2">
    <link rel="alternate stylesheet" href="css/color-schemes/color4.css" title="color4">
    <link rel="alternate stylesheet" href="css/color-schemes/color5.css" title="color5">

    <%--    edit by fjh--%>
    <link rel="stylesheet" href="layui/css/layui.css">

    <%--    edit by fjh--%>
    <style>
        .wider-label{
            width: 120px;
        }

        .wider-form-item{
            width: 350px;
        }
    </style>
</head>
<body class="expand-data panel-data">


<header class="side-header light-skin expand-header">
    <div class="nav-head">主菜单<span class="menu-trigger"><i class="ion-android-menu"></i></span></div>
    <nav class="custom-scrollbar">
        <ul class="drp-sec">
            <li class="has-drp"><a href="#" title=""><i class="ion-home"></i> <span>房间占用查询</span></a>
                <ul class="sb-drp">
                    <li><a href="/hotelsystem/searchOccupyRoom" title="">查询</a></li>
                </ul>
            </li>
        </ul>
        <ul class="drp-sec">
            <li class="has-drp"><a href="#" title=""><i class="ion-home"></i> <span>客房账单管理</span></a>
                <ul class="sb-drp">
                    <li><a href="/hotelsystem/roomBillPage" title="">客房账单</a></li>
                </ul>
            </li>
        </ul>
        <ul class="drp-sec">
            <li class="has-drp"><a href="#" title=""><i class="ion-android-contact"></i> <span>入住服务</span></a>
                <ul class="sb-drp">
                    <li><a href="/hotelsystem/addStayBusiness" title="">登记入住</a></li>
                </ul>
                <ul class="sb-drp">
                    <li><a href="/hotelsystem/stayBusinessPage" title="">住房服务管理</a></li>
                </ul>
            </li>
        </ul>
        <ul class="drp-sec">
            <li class="has-drp"><a href="#" title=""><i class="ion-fireball"></i> <span>预定服务</span></a>
                <ul class="sb-drp">
                    <li><a href="/hotelsystem/addRoomBusiness" title="">预定客房</a></li>
                    <li><a href="/hotelsystem/roomBusinessPage" title="">预定业务管理</a></li>
                </ul>
            </li>
        </ul>
        <ul class="drp-sec">
            <li class="has-drp"><a href="#" title=""><i class="ion-fireball"></i> <span>房客管理</span></a>
                <ul class="sb-drp">
                    <li><a href="${pageContext.request.contextPath}/getGuestMain.action" title="">房客列表</a></li>
                </ul>
            </li>
        </ul>
        <ul class="drp-sec">
            <li class="has-drp"><a href="#" title=""><i class="ion-fireball"></i> <span>会员管理</span></a>
                <ul class="sb-drp">
                    <li><a href="${pageContext.request.contextPath}/getVipMain.action" title="">会员列表</a></li>

                </ul>
            </li>
        </ul>
        <ul class="drp-sec">
            <li class="has-drp"><a href="#" title=""><i class="ion-fireball"></i> <span>商品订单</span></a>
                <ul class="sb-drp">
                    <li><a href="${pageContext.request.contextPath}/goodsOrder.findAll?page=1&sie=4" title="">查看商品订单</a></li>
                </ul>
            </li>
        </ul>
    </nav>
</header><!-- Side Header -->


<div class="option-panel">
    <span class="panel-btn"><i class="fa ion-android-settings fa-spin"></i></span>
    <div class="color-panel">
        <h4>Text Color</h4>
        <span class="color1" onclick="setActiveStyleSheet('color1'); return false;"><i></i></span>
        <span class="color2" onclick="setActiveStyleSheet('color2'); return false;"><i></i></span>
        <span class="color3" onclick="setActiveStyleSheet('color'); return false;"><i></i></span>
        <span class="color4" onclick="setActiveStyleSheet('color4'); return false;"><i></i></span>
        <span class="color5" onclick="setActiveStyleSheet('color5'); return false;"><i></i></span>
    </div>
</div><!-- Options Panel -->


<div class="panel-content">
    <div class="filter-items">
        <div class="row grid-wrap mrg20">
            <div class="col-md-12 grid-item col-sm-12 col-lg-12">
                <div class="widget proj-order pad50-40">
                    <div class="wdgt-opt">
                        <span class="wdgt-opt-btn"><i class="ion-android-more-vertical"></i></span>
                        <div class="wdgt-opt-lst brd-rd5">
                            <a class="delt-wdgt" href="#" title="">Delete</a>
                            <a class="expnd-wdgt" href="#" title="">Expand</a>
                            <a class="refrsh-wdgt" href="#" title="">Refresh</a>
                        </div>
                    </div>
                    <div class="wdgt-ldr">
                        <div class="ball-scale-multiple">
                            <div></div>
                            <div></div>
                            <div></div>
                        </div>
                    </div>
                    <h4 class="widget-title" style="margin-bottom: 10px;">添加账单</h4>


                    <form id="myform" class="layui-form" action="">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">客户id</label>
                                <div class="layui-input-block">
                                    <input type="text" name="guest_id_1" autocomplete="off"
                                           lay-verify="required" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">客户id</label>
                                <div class="layui-input-block">
                                    <input type="text" name="guest_id_2" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">房间id</label>
                                <div class="layui-input-block">
                                    <input type="text" name="room_id" lay-verify="required"
                                           autocomplete="off" class="layui-input" id="input-roomid">
                                </div>

                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">职员id</label>
                                <div class="layui-input-block">
                                    <input type="text" name="staff_id" lay-verify="required"
                                           autocomplete="off" class="layui-input" id="input-staffid">
                                </div>

                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">入住天数</label>
                            <div class="layui-input-block">
                                <input type="text" name="last_days" lay-verify="required"
                                       autocomplete="off" class="layui-input" id="input-last">
                            </div>

                        </div>
                        <div class="layui-row">
                            <div class="layui-col-md8 layui-col-md-offset3 bo ttt">
                                <label class="layui-form-label" style="width:30%;">入住时间</label>
                                <input type="text" name="start_time" lay-verify="required" id="start_time" placeholder="开始日期" autocomplete="off" readonly="readonly" class="layui-input" style="width:70%;">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">总价</label>
                            <div class="layui-input-block">
                                <input type="text" name="total" lay-verify="required|total"
                                       autocomplete="off" class="layui-input" id="input-total">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button type="submit" class="layui-btn" lay-submit="" lay-filter="form-room-bill">确认添加</button>

                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div><!-- Filter Items -->
</div><!-- Panel Content -->
</div>



<footer>
    <p>Copyright <a href="http://www.bootstrapmb.com" title="">Example Company</a> &amp; 2017 - 2018</p>
    <span>10GB of 250GB Free.</span>
</footer>

<!-- Vendor: Javascripts -->
<%--<script src="js/jquery.min.js" type="text/javascript"></script>--%>
<script src="js/jquery-3.5.1.min.js" type="text/javascript"></script>
<!-- Vendor: Followed by our custom Javascripts -->
<script src="js/bootstrap.min.js" type="text/javascript"></script>
<script src="js/jquery-ui.min.js" type="text/javascript"></script>
<script src="js/select2.min.js" type="text/javascript"></script>
<script src="js/slick.min.js" type="text/javascript"></script>

<!-- Our Website Javascripts -->
<script src="js/isotope.min.js" type="text/javascript"></script>
<script src="js/isotope-int.js" type="text/javascript"></script>
<script src="js/jquery.counterup.js" type="text/javascript"></script>
<script src="js/waypoints.min.js" type="text/javascript"></script>
<script src="js/highcharts.js" type="text/javascript"></script>
<script src="js/exporting.js" type="text/javascript"></script>
<script src="js/highcharts-more.js" type="text/javascript"></script>
<script src="js/moment.min.js" type="text/javascript"></script>
<script src="js/jquery.circliful.min.js" type="text/javascript"></script>
<script src="js/fullcalendar.min.js" type="text/javascript"></script>
<script src="js/jquery.downCount.js" type="text/javascript"></script>
<script src="js/jquery.bootstrap-touchspin.min.js" type="text/javascript"></script>
<script src="js/jquery.formtowizard.js" type="text/javascript"></script>
<script src="js/form-validator.min.js" type="text/javascript"></script>
<script src="js/form-validator-lang-en.min.js" type="text/javascript"></script>
<script src="js/cropbox-min.js" type="text/javascript"></script>
<script src="js/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="js/ion.rangeSlider.min.js" type="text/javascript"></script>
<script src="js/jquery.poptrox.min.js" type="text/javascript"></script>
<script src="js/styleswitcher.js" type="text/javascript"></script>
<script src="js/main.js" type="text/javascript"></script>


<%--edit by fjh--%>
<script src="layui/layui.js"></script>
<script src="js/fjhutil.js"></script>
<script>

    layui.use(['form', 'layedit', 'laydate','jquery'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,laydate = layui.laydate
        var $ = layui.jquery;

        var nowTime = new Date().valueOf();

        var start_time = laydate.render({
            elem: '#start_time',
            min:nowTime,
            max:30
        });


       form.verify({
            total: function (value) {
                var d = Number(value)
                if(isNaN(d)){
                    return '请输入正确数字格式'
                }else if(d <= 0){
                    return '大于0'
                }
            },
            last_days: function (value) {
                var d = Number(value)
                if(isNaN(d) || !isInteger(d)){
                    return '请输入正确住房时间'
                }else if(d <= 0){
                    return '大于0'
                }
            },
        });



        //监听提交

        form.on('submit(form-room-bill)', function(data){

                var formData = new FormData($("#myform")[0])

                $.ajax({
                    url:'addRoom_Bill',
                    type:'POST',
                    dataType:"JSON",
                    data:formData,
                    processData:false,//提交formData必须要设置
                    contentType:false,//提交formData必须要设置
                    cache:false,
                    success:function (resp) {
                        if (resp.code == 0){
                            layer.alert("添加成功！")
                            /*setTimeout(function () {
                                location.reload()
                            }, 1000)*/
                        }else {
                            layer.alert(resp.msg)
                        }
                    },
                    error:function () {
                        layer.alert('请求出错')
                    }
                })
                return false
            });
        }
    );
</script>

</body>
</html>


